package com.hxzy.shop.commodity.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hxzy.shop.entity.DrugDetails;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

public interface DrugDetailsService extends IService<DrugDetails> {
    /**
     * 添加详细图
     * @param drugUid 药品id
     * @param detailedDescription 详细图地址
     * @return 是否成功
     */
    @Transactional(rollbackFor = Exception.class)
    boolean addDetails(Long drugUid, List<String> detailedDescription);

    /**
     * 根据id获得药品的详细图
     * @param id  药品的id
     * @return  k 详细图的顺序， v url
     */
    Map<Integer, String> getDetails(Long id);

    /**
     * 更新药品详细图
     * @param id 药品id
     * @param detailedImage 是否成功
     * @return 是否成功
     */
    boolean updateDetails(Long id, List<String> detailedImage);
}